package model.basics;


import java.util.HashMap;
import java.util.List;
import java.util.Vector;

import model.search.Order;




public  class ClassRoom implements model.search.interfaces.ClassRoom{
	private int id;
	private int maxCapacity;
	private String name;
	private HashMap <Resource, Integer> resources;
	private Boolean operational;
	private List <Order> orders;
	
	public ClassRoom(int id, int maxCapacity, String name){
		this.setMaxCapacity(maxCapacity);
		this.setName(name);
		this.changeOperationalStatus(false);
		this.setResources(new HashMap<Resource, Integer>());
		this.id = id;
		this.orders = new Vector<Order>();
	}

	public void setMaxCapacity(int maxCapacity) {
		this.maxCapacity = maxCapacity;
	}

	public int getMaxCapacity() {
		return maxCapacity;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}
	
	//added by Alexis
	public String toString(){
		return name;
	}
	////////////////
	
	public void setResources(HashMap<Resource, Integer> resources) {
		this.resources = resources;
	}

	public HashMap<Resource, Integer> getResources() {
		return resources;
	}

	public void changeOperationalStatus(Boolean operational) {
		this.operational = operational;
	}

	public Boolean getOperationalStatus() {
		return operational;
	}
	
	public void addResource(Resource z){
		if (this.getResources().containsKey(z)){
			this.getResources().put(z, this.getResources().get(z)+1);
		}
		else{
			this.getResources().put(z, 1);
		}
	}
	
	public void removeResource(Resource x){
		this.getResources().remove(x);
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public void setOrders(List <Order> orders) {
		this.orders = orders;
	}

	public List <Order> getOrders() {
		return orders;
	}


	
}
